package com.linzelin.mapper;

import com.linzelin.pojo.SysRole;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;
import org.springframework.stereotype.Repository;

import java.util.List;

@Mapper
@Repository
public interface RoleMapper extends tk.mybatis.mapper.common.Mapper<SysRole> {
    /*这里继承的就是角色的mapper了*/

    @Select(" SELECT role.`id`,role.`rolename` AS roleName ,role.`context` " +
            " FROM role,role_user " +
            " WHERE role.`id` = role_user.`role_id` AND role_user.`user_id` = #{uid}")
    List<SysRole> findByUid(Integer uid);
}
